package com.xuxueli.applyModules.utils.testzipswager;

import lombok.AllArgsConstructor;

/**
 * @Description: 参数类型
 **/
@AllArgsConstructor
public enum SwaggerFieldTypeEnum {

	STRING(1L, "string"),
	NUMBER(2L, "integer"),
	BOOLEAN(3L, "boolean"),
	DATE(4L, "string"),
	TIME(5L, "string"),
	DATETIME(6L, "string"),
	JSON(7L, "object"),
	JSON_ARRAY(8L, "array"),
	BYTE_ARRAY(9L, "array"),
	ARRAY(10L, "array"),
	FILE(12L, "string");

	private Long id;
	private String code;

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public String getCode() {
		return code;
	}

	public void setCode(String code) {
		this.code = code;
	}

	public static SwaggerFieldTypeEnum getById(Long id) {
		SwaggerFieldTypeEnum[] fieldTypeEnums = SwaggerFieldTypeEnum.values();
		for (SwaggerFieldTypeEnum typeEnum : fieldTypeEnums) {
			if (typeEnum.getId().equals(id)) {
				return typeEnum;
			}
		}
		return null;
	}
}
